package com.fagejiang.security.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.security.Principal;

/**
 * TODO
 *
 * @author 发哥讲Java
 * @version 1.0
 * @date 2021-05-19 9:59
 */
@Controller
@RequestMapping("/security")
public class SecurityController {
    @GetMapping("/loginuser")
    @ResponseBody
    public Principal currentUserName(Principal principal) {
        return principal;
    }

}
